package com.e3.basdoc.dept.client;

import java.util.List;

import com.e3.basdoc.dept.model.DeptModel;
import com.e3.template.tgf.TGFTreePanelAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * Description: <br>
 * 
 * @author: <a href="mailto:senton1101@126.com">TianXiangdong</a> 2010-7-27 上午11:15:50
 * @version: 1.0
 */
public class DeptTreePanel extends TGFTreePanelAsync<DeptModel> {
	
	private DeptRPCServiceAsync service = DeptRPCService.Util.getInstance();

	@Override
	public String getTreeDisplayFieldName() {
		return DeptModel.NAME;
	}

	@Override
	public void excuteLoadModelChildren(DeptModel pModel,AsyncCallback<List<DeptModel>> callback) {
		service.getDeptChildren(pModel, callback);
	}

	@Override
	public String getRootDisplayName() {
		return DeptMessages.INSTANCE.tree_root_name();
	}

	@Override
	protected boolean isRootModel(DeptModel model) {
		return DeptHelper.INSTANCE.isRootModel(model);
	}

}
